/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Portions created by the Initial Developer are
 * Copyright (C) 2012 the Initial Developer.
 * All Rights Reserved.
 *
 * The Original Code is "http://semi-frame.googlecode.com/svn/trenk/".
 *
 * The Initial Developer of the Original Code is the author below.
 */
/**
 * @file LogUtil.h
 * @brief Utility of log.
 * @author mornongcloud
 * @date 2011/11/21
 */

#ifndef SEMIUTILLOGUTIL_H_
#define SEMIUTILLOGUTIL_H_

#include <iomanip>
#include "semi/util/DateUtil.h"
#include "semi/util/FileUtil.h"

namespace semi {

namespace util {

class LogUtil {
public:
	LogUtil();
	virtual ~LogUtil();

	//    static bool rollover(int days);

	/**
	 * @brief Logging.
	 *
	 * @param msg Log message
	 * @param func __func__
	 * @param file __FILE__
	 * @param line __LINE__
	 *
	 * @return Log message string.
	 */
	static std::string createMessage(std::string msg, std::string func,
			std::string file, int line);

	static std::string HexString(void *data, int length, bool rtn = true);

	static std::string EbcdicHexString(void *data, int length);

	//private:
	//	static bool rollover(std::string logDir, int days);

};

}

}

#endif /* SEMIUTILLOGUTIL_H_ */
